home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / faq / kjvcbibl.lha / cbible / rexx / addlabel.thnkr < prev    next >
Text File  |  1992-12-05  |  1KB  |  65 lines

  1. /* */
  2. options results
  3. address 'Thinker'
  4. trace off
  5.  
  6. 'get see-thru'
  7. cthru=rc
  8.  
  9. 'position save 1'
  10. 'get selected'
  11. if rc ~= 0 then exit 1
  12. selected = result
  13.  
  14. if cthru = 1 then 'see-thru disable'
  15. 'get current'
  16. current=result
  17. 'get styles'
  18. styles=result
  19. if rc = 0 then arestyles=1
  20. else arestyles=0
  21.  
  22. if substr(current,1,1) = '(' then do
  23.     brk=index(current,')',1)
  24.     if brk=0 then do
  25.        if cthru = 1 then 'see-thru enable'
  26.        'position restore 1'
  27.        exit 2
  28.     end
  29. end
  30. else do
  31.     current = '()' || current
  32.     if arestyles = 1 then styles= '0000'X || styles
  33.     brk=2
  34. end
  35.  
  36. firsttxt=substr(current,1,brk-1)
  37. lasttxt=substr(current,brk)
  38. if arestyles = 1 then do
  39.     firststyle=substr(styles,1,brk-1)
  40.     laststyle=substr(styles,brk)
  41. end
  42. len=length(selected)
  43.  
  44. if substr(current,1,2) ~= '()' then do
  45.     firsttxt = firsttxt || ','
  46.     len=len+1
  47. end
  48.  
  49. firsttxt=firsttxt || selected
  50. current=firsttxt || lasttxt
  51.  
  52. if arestyles = 1 then do
  53.     do i=1 to len
  54.         firststyle = firststyle || '00'X
  55.     end
  56.     styles = firststyle || laststyle
  57. end
  58.  
  59. 'update current' current
  60. if arestyles = 1 then 'update styles' styles
  61.  
  62. if cthru = 1 then 'see-thru enable'
  63. 'position restore 1'
  64. exit 0
  65.